package com.wanpinghui.wphlibrary.model.object.bean;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

/***
 * 功能描述:
 * 作者:qiujialiu
 * 时间:2017/12/14
 ***/

public class FeedBackReasonBean {
    private String name;
    private int key;
    private boolean enable = true;
    private Map<String, String> son;
    private List<KeyValueData> datas;

    public FeedBackReasonBean() {
    }

    public FeedBackReasonBean(String name) {
        this.name = name;
    }

    public FeedBackReasonBean(int key, String name, boolean enable) {
        this.name = name;
        this.key = key;
        this.enable = enable;
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }

    public String getName() {
        return name;
    }

    public Map<String, String> getSon() {
        return son;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setSon(Map<String, String> son) {
        this.son = son;
    }

    public List<KeyValueData> getDatas() {
        return datas;
    }

    public void setDatas(List<KeyValueData> datas) {
        this.datas = datas;
    }

    public int getKey() {
        return key;
    }

//    public List<KeyValueData> getReasonData() {
//        if (datas != null && datas.size() > 0) {
//            return datas;
//        }else {
//            if (son != null) {
//                datas = new ArrayList<>();
//                Set<String> keySet = son.keySet();
//                for (String name : keySet) {
//                    KeyValueData data = new KeyValueData();
//                    data.key = name;
//                    data.value = son.get(name);
//                    if (datas.size() == 0) {
//                        data.selected = true;
//                    }
//                    datas.add(data);
//                }
//                return datas;
//            }
//            return null;
//        }
//    }

    public static class KeyValueData{
        public int key;
        public String value;
        public boolean selected;

        public KeyValueData() {
        }

        public KeyValueData(int key, String value) {
            this.key = key;
            this.value = value;
        }
    }
}
